<%-- 
    Document   : usuario
    Created on : 11/03/2008, 16:22:34
    Author     : Tom Hayden
--%>

<%@page contentType="text/html" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<script type="text/javascript">
    
    function excluirRegistro() {
    	if (confirm('<fmt:message key="message.confirmdelete"/>')) {
    		callAction('manterUsuario', 'excluir', 'usuarioForm');
    	}
    }
    
</script>
        
<h1><fmt:message key="manterusuario.detalhe.title"/></h1>

<form name="usuarioForm" action="manterUsuario.do" method="post">
    <input type="hidden" name="method" value="salvar" />
    <input type="hidden" name="acao" value="${acao}" />
    <input type="hidden" name="id" value="${bean.id}" />
    <table class="form">
        <tbody>
            <tr>
                <th><fmt:message key="manterusuario.field.description"/>:</th>
                <td class="required"><input type="text" name="description" value="${bean.description}" size="25" /></td>
            </tr>
            <tr>
                <th><fmt:message key="manterusuario.field.login"/>:</th>
                <td class="required"><input type="text" name="login" value="${bean.login}" size="25" /></td>
            </tr>
            <tr>
                <th><fmt:message key="manterusuario.field.perfil"/>:</th>
                <td class="required">
                    <select name="idPerfil">
                        <c:forEach var="item" items="${collection}">
                        <option value="${item.id}" <c:if test="${bean.perfil.id == item.id}">selected</c:if>>${item.description}</option>
                        </c:forEach>
                    </select>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td align="left">
                    <input type="submit" value="<fmt:message key='global.label.botaosalvar'/>" />
                    <c:if test="${acao == 'alterar'}">
                        <input type="button" value="<fmt:message key='global.label.botaoexcluir'/>" onclick="excluirRegistro();"/>
                    </c:if>                    
                    <input type="button" value="<fmt:message key='global.label.botaovoltar'/>" onclick="goURL('manterUsuario.do?method=listar');">
                </td>
            </tr>
        </tbody>
    </table>
</form>